package cn.com.chengmandian.service.erp.constants;

/**
 * Description: cmd-erp-crm
 * <p>
 * Created by asus on 2022/3/16 16:53
 */
public enum OaBusinessTypeEnum {

    CONTRACT(1, "合同审批","【合同审批】"),
    ORDER_INFO(2,"业务订单","【业务订单】"),
    CONTRACT_BORROW(3,"合同借阅","【合同借阅】"),
    CONTRACT_SEAL(4,"合同盖章","【合同盖章】"),
    BATTERY_INVENTORY_REMIND(5,"电池盘点异常","【电池盘点异常】"),
    STOCK_PURCHASE_APPLY(6,"库存采购申请","【库存采购申请】"),
    STOCK_APPLY(7,"请购申请","【请购申请】"),
    PART_ALLOT(8,"备件调拨","【维修配件调拨申请（城市端）】");

    private Integer code;

    private String name;

    private String templateName;

    public Integer getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public String getTemplateName(){ return this.templateName; }

    OaBusinessTypeEnum(Integer code, String name, String templateName) {
        this.code = code;
        this.name = name;
        this.templateName = templateName;
    }

    public static OaBusinessTypeEnum getByCode(Integer code){
        if(code == null){
            return null;
        }else{
            OaBusinessTypeEnum[] values = values();
            for(OaBusinessTypeEnum oaBusinessTypeEnum :values){
                if(oaBusinessTypeEnum.getCode().equals(code)){
                    return oaBusinessTypeEnum;
                }
            }
        }
        return null;
    }
}
